import gradio as gr
import os
from train import trainingApp
from chatbot import  chatbotApp
if __name__ == '__main__':
    appList = [chatbotApp,trainingApp]
    appNameList = ['推理','训练']
    app = gr.TabbedInterface(appList, appNameList)
    random_port = os.getenv("random_port", "False")
    if eval(random_port):
        app.queue(concurrency_count=1).launch()
    else:
        app.queue(concurrency_count=1).launch(server_port=6006)